package me.winds.parallax;

import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentPagerAdapter;
import android.support.v4.view.PagerAdapter;
import android.support.v4.view.ViewPager;
import android.support.v7.app.AppCompatActivity;
import android.view.Gravity;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;


import java.util.ArrayList;
import java.util.List;

import me.winds.testing.R;

/**
 * Auther:  winds
 * Email:   heardown@163.com
 * Date:    2018/1/9.
 * Desc:
 */

public class ParallaxTestActivity extends BaseActivity {

    @Override
    protected int getLayoutRes() {
        return R.layout.activity_parallax_test;
    }

    @Override
    protected void initView() {
        ViewPager pager = findViewById(R.id.vp_pager);
        final List<Fragment> list = new ArrayList<>();
        list.add(new Parallax01Fragment());
        list.add(new Parallax02Fragment());
        pager.setPageTransformer(true, new DepthPageTransformer());
        pager.setAdapter(new FragmentPagerAdapter(getSupportFragmentManager()) {
            @Override
            public int getCount() {
                return list.size();
            }

            @Override
            public Fragment getItem(int position) {
                return list.get(position);
            }
        });
    }

}
